package my.poemlib;

import my.poemlib.bo.PoemBo;
import my.poemlib.bo.UserBo;
import my.poemlib.vo.PageControl;
import my.poemlib.vo.Poem;
import my.poemlib.vo.User;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Facade implements PoemBo,UserBo{

	public static ApplicationContext context  = new ClassPathXmlApplicationContext("applicationContext.xml");
	
	@Autowired
	public PoemBo pemBo;
	
	@Autowired
	public UserBo userBo;
	
	
	public static Facade facade = (Facade) context.getBean("facade");


	@Override
	public User getUser(String userName,String password) {
		return userBo.getUser(userName,password);
	}


	@Override
	public void insertPeom(Poem p) {
		pemBo.insertPeom(p);
	}


	@Override
	public void delPeom(long id) {
		pemBo.delPeom(id);
	}


	@Override
	public void queryByWord(String w, PageControl pc) {
		pemBo.queryByWord(w, pc);
	}
}
